#!/bin/bash
set -e
set -x
MYDIR="${0%/*}"
cd "$MYDIR/.."
source "recipes/common.sh"


# RECIPE START zlib-native

save_CFLAGS="$CFLAGS"
save_CPPFLAGS="$CPPFLAGS"
save_LDFLAGS="$LDFLAGS"
export CFLAGS='-O2 -g'
unset CPPFLAGS
unset LDFLAGS

mkdir -p build/zlib-native
cd build/zlib-native
# Thanks God zlib does NOT use autocrap
../../zlib/configure \
	--prefix=$build_prefix \
	--libdir=$build_prefix/lib \
	${NIL}

cd ../..
make_native_build build/zlib-native

export CFLAGS="$save_CFLAGS"
export CPPFLAGS="$save_CPPFLAGS"
export LDFLAGS="$save_LDFLAGS"

# RECIPE END zlib-native
